var i = require("../../../uv-ui-tools/libs/mixin/mpMixin.js"), t = require("../../../uv-ui-tools/libs/mixin/mixin.js"), e = require("./icons.js"), s = require("./props.js"), n = require("../../../../common/vendor.js");

require("../../../uv-ui-tools/libs/function/index.js"), require("../../../uv-ui-tools/libs/function/test.js"), 
require("../../../uv-ui-tools/libs/function/digit.js"), require("../../../uv-ui-tools/libs/util/route.js"), 
require("../../../uv-ui-tools/libs/function/debounce.js"), require("../../../uv-ui-tools/libs/function/throttle.js");

var o = {
    name: "uv-icon",
    emits: [ "click" ],
    mixins: [ i.mpMixin, t.mixin, s.props ],
    data: function() {
        return {
            colorType: [ "primary", "success", "info", "error", "warning" ]
        };
    },
    computed: {
        uClasses: function() {
            var i = [];
            return i.push(this.customPrefix), i.push(this.customPrefix + "-" + this.name), this.color && this.colorType.includes(this.color) && i.push("uv-icon__icon--" + this.color), 
            i;
        },
        iconStyle: function() {
            var i = {};
            return i = {
                fontSize: this.$uv.addUnit(this.size),
                lineHeight: this.$uv.addUnit(this.size),
                fontWeight: this.bold ? "bold" : "normal",
                top: this.$uv.addUnit(this.top)
            }, this.color && !this.colorType.includes(this.color) && (i.color = this.color), 
            i;
        },
        isImg: function() {
            var i = this.name.indexOf("data:") > -1 && this.name.indexOf("base64") > -1;
            return -1 !== this.name.indexOf("/") || i;
        },
        imgStyle: function() {
            var i = {};
            return i.width = this.width ? this.$uv.addUnit(this.width) : this.$uv.addUnit(this.size), 
            i.height = this.height ? this.$uv.addUnit(this.height) : this.$uv.addUnit(this.size), 
            i;
        },
        icon: function() {
            var i = e.icons["uvicon-" + this.name];
            return i ? unescape("%u".concat(i)) : [ "uvicon" ].indexOf(this.customPrefix) > -1 ? this.name : "";
        }
    },
    methods: {
        clickHandler: function(i) {
            this.$emit("click", this.index), this.stop && this.preventEvent(i);
        }
    }
}, u = n._export_sfc(o, [ [ "render", function(i, t, e, s, o, u) {
    return n.e({
        a: u.isImg
    }, u.isImg ? {
        b: i.name,
        c: i.imgMode,
        d: n.s(u.imgStyle),
        e: n.s(i.$uv.addStyle(i.customStyle))
    } : {
        f: n.t(u.icon),
        g: n.n(u.uClasses),
        h: n.s(u.iconStyle),
        i: n.s(i.$uv.addStyle(i.customStyle)),
        j: i.hoverClass
    }, {
        k: "" !== i.label
    }, "" !== i.label ? {
        l: n.t(i.label),
        m: i.labelColor,
        n: i.$uv.addUnit(i.labelSize),
        o: "right" == i.labelPos ? i.$uv.addUnit(i.space) : 0,
        p: "bottom" == i.labelPos ? i.$uv.addUnit(i.space) : 0,
        q: "left" == i.labelPos ? i.$uv.addUnit(i.space) : 0,
        r: "top" == i.labelPos ? i.$uv.addUnit(i.space) : 0
    } : {}, {
        s: n.o(function() {
            return u.clickHandler && u.clickHandler.apply(u, arguments);
        }),
        t: n.n("uv-icon--" + i.labelPos)
    });
} ], [ "__scopeId", "data-v-eab170a5" ] ]);

wx.createComponent(u);